package com.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.BuyOrderBean;
import com.project.service.IBuyOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("buyOrder")
@Api(tags = "采购信息")
public class BuyOrderController {
    @Autowired
    private IBuyOrderService buyOrderService;
    @ApiOperation(value = "分页查询采购信息")
    @RequestMapping("findByItem")
    public IPage<BuyOrderBean> findByItem(Integer pageNO, String supplierName, LocalDate startDate, LocalDate endDate){
        return buyOrderService.findByItem(pageNO, supplierName, startDate, endDate);
    }
    @ApiOperation(value = "按采购详情id，查询采购信息。同时查询采购明细信息")
    @RequestMapping("findById")
    public BuyOrderBean findById(Integer buyOrderId){
        return buyOrderService.findById(buyOrderId);
    }
}
